<#assign module="company"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/bootstrap-switch.min.css">
<link rel="stylesheet" href="${ctx}/assets/css/uploadify.css">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
</@override>
<@override name="body">
<div class="row">
	<div class="col-md-12">
		<div class="tabbable"> <!-- Only required for left/right tabs -->
			 <ul class="nav nav-tabs">
			 	<li class="active"><a href="#tab1" data-toggle="tab">短信</a></li>
			 	<li><a href="#tab2" data-toggle="tab">收费内容</a></li>
			 	<li><a href="#tab3" data-toggle="tab">客户推荐提成</a></li>
			 	<li><a href="#tab4" data-toggle="tab">服务人员推荐提成</a></li>
			 	<li><a href="#tab5" data-toggle="tab">客户二维码背景图</a></li>
			    <li><a href="#tab6" data-toggle="tab">服务人员二维码背景图</a></li>
			    <li><a href="#tab7" data-toggle="tab">服务协议</a></li>
			    <li><a href="#tab8" data-toggle="tab">分享设置</a></li>
			 </ul>
			 <form id="submit_form" action="${ctx}/company/saveSetting" class="form-horizontal" role="form" method="post">
			 		<input type="hidden" id="companyId" name="companyId" value="${company.id?if_exists}">
			 		
			 		<div class="form-group margin-top">
			 			<div class="col-sm-3">
					 		<input id="submit_button" type="submit" class="btn btn-primary" value="保存设置">
					 		<input type="button" class="btn btn-default" onclick="window.location.href = '${ctx}/company/list';" value="返回">
					 	</div>
					</div>
					
			  		<div class="tab-content">
			  			
			  			<div class="tab-pane fade in active" id="tab1">
			  				<div class="panel panel-default margin-top">
								<div class="panel-heading">短信</div>
								<div class="panel-body">
									<@shiro.hasPermission name='smstemplet'>
									    <div class="form-group">
						                    <label class="col-sm-3 control-label"></label>
						                    <div class="col-sm-6">
						                    	<font color="red">注：每64个字符（空格、特殊字符等也算作一个字符）算作一条短信，超出部分未满64个字符也算作一条，长度以实际收到短信长度为准。</font>
						                    </div>
							            </div>
							            
							            <div class="form-group">
						                    <label class="col-sm-3 control-label"><em>*</em>短信签名：</label>
						                    <div class="col-sm-3">
						                    	<input class="form-control" id="signName" name="signName" value="${company.signName?if_exists}" type="text" />
						                    </div>
							            </div>
							            
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	新建服务人员发送密码：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="driverCreate" name="driverCreate"><#if sms_driverCreate??>${sms_driverCreate.content?if_exists}</#if></textarea>
								        		<span class="help-block">
								        		<p>
								        			参数：{服务人员名}、{称呼}、{公司名}、{服务人员账号}、{密码}
								        		</p>
								        		{称呼}为"先生"或"女士"
								        		</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	修改服务人员密码：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="driverChangePassword" name="driverChangePassword"><#if sms_driverChangePassword??>${sms_driverChangePassword.content?if_exists}</#if></textarea>
								        		<span class="help-block">
								        		<p>
								        			参数：{服务人员名}、{称呼}、{服务人员账号}、{密码}
								        		</p>
								        		{称呼}为"先生"或"女士"
								        		</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	服务人员充值：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="driverMoney" name="driverMoney"><#if sms_driverMoney??>${sms_driverMoney.content?if_exists}</#if></textarea>
								        		<span class="help-block">
								        		<p>
								        			参数：{服务人员名}、{称呼}、{服务人员账号}、{充值金额}
								        		</p>
								        		{称呼}为"先生"或"女士"
								        		</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	客户端登陆验证码：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="memberCode" name="memberCode"><#if sms_memberCode??>${sms_memberCode.content?if_exists}</#if></textarea>
								        		<span class="help-block">
								        		<p>
								        			参数：{公司名}、{验证码}
								        		</p>
								        		</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	司机端登陆验证码：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="driverCode" name="driverCode"><#if sms_memberCode??>${sms_driverCode.content?if_exists}</#if></textarea>
								        		<span class="help-block">
								        		<p>
								        			参数：{公司名}、{验证码}
								        		</p>
								        		</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	派给服务人员新工单：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="newOrder" name="newOrder"><#if sms_newOrder??>${sms_newOrder.content?if_exists}</#if></textarea>
								        		<span class="help-block">
								        		<p>
								        			参数：{订单号}、{客户姓名}、{客户电话}、{预约时间}、{预约地点}
								        		</p>
								        		</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	服务人员被销单：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="cancelOrder" name="cancelOrder"><#if sms_cancelOrder??>${sms_cancelOrder.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	服务人员被强制销单：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="powerCancelOrder" name="powerCancelOrder"><#if sms_powerCancelOrder??>${sms_powerCancelOrder.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	服务人员订单被收回：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="revokeOrder" name="revokeOrder"><#if sms_revokeOrder??>${sms_revokeOrder.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	服务人员订单被强制收回：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="powerRevokeOrder" name="powerRevokeOrder"><#if sms_powerRevokeOrder??>${sms_powerRevokeOrder.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	服务人员接单（发给客户）：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="driverAccept" name="driverAccept"><#if sms_driverAccept??>${sms_driverAccept.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{服务人员名}、{服务人员工号}、{服务人员电话}、{订单号}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	到达预约地（发给客户）：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="arriveFromPlace" name="arriveFromPlace"><#if sms_arriveFromPlace??>${sms_arriveFromPlace.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{服务人员名}、{服务人员工号}、{服务人员电话}、{订单号}、{预约地}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	订单完成（发给客户）：
									        </label>
									        <div class="col-sm-6">
												<textarea rows="5" cols="60" id="orderFinished" name="orderFinished"><#if sms_orderFinished??>${sms_orderFinished.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}、{服务人员工号}、{等候时间}、{行驶公里}、{收费金额}、{支付方式}、{投诉建议电话}
								        		</p>
							        			{支付方式}为"签单"或"现金"
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	修改订单金额（发给客户）：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="modifyCash" name="modifyCash"><#if sms_modifyCash??>${sms_modifyCash.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}、{收费金额}、{投诉建议电话}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	给服务人员预派单：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="yupaiOrder" name="yupaiOrder"><#if sms_yupaiOrder??>${sms_yupaiOrder.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{订单号}、{客户姓名}、{客户电话}、{预约时间}、{预约地点}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	客户存入：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="memberRechargeRecord" name="memberRechargeRecord"><#if sms_memberRechargeRecord??>${sms_memberRechargeRecord.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{存入金额}、{余额}、{电话}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	客户支出：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="memberConsumedRecord" name="memberConsumedRecord"><#if sms_memberConsumedRecord??>${sms_memberConsumedRecord.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{支出金额}、{余额}、{电话}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	活动返现/返劵：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="activity" name="activity"><#if sms_activity??>${sms_activity.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{活动名称}、{返现金额}、{余额}、{投诉建议电话}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	客户/服务人员充值：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="recharge" name="recharge"><#if sms_recharge??>${sms_recharge.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{名称}、{充值金额}、{充值方式}
								        		</p>
							        			</span>
											</div>
									    </div>

									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	购买代驾险（发给客户）：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="baoxianMember" name="baoxianMember"><#if sms_baoxianMember??>${sms_baoxianMember.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{保险编号}、{保单号}、{客户姓名}
								        		</p>
							        			</span>
											</div>
									    </div>
									    
									    <div class="form-group">
									        <label class="col-sm-3 control-label">
									        	购买代驾险（发给服务人员）：
									        </label>
									        <div class="col-sm-5">
												<textarea rows="5" cols="60" id="baoxianDriver" name="baoxianDriver"><#if sms_baoxianDriver??>${sms_baoxianDriver.content?if_exists}</#if></textarea>
								        		<span class="help-block">
							        			<p>
								        			参数：{保险编号}、{保单号}、{服务人员名}
								        		</p>
							        			</span>
											</div>
									    </div>

									    <@pao>
									    	<h4>跑腿短信模板</h4><hr/>
									    	
									    	<div class="form-group">
										        <label class="col-sm-3 control-label">
										        	派给服务人员新工单：
										        </label>
										        <div class="col-sm-5">
													<textarea rows="5" cols="60" id="paiPaotuiOrder" name="paiPaotuiOrder"><#if sms_paiPaotuiOrder??>${sms_paiPaotuiOrder.content?if_exists}</#if></textarea>
									        		<span class="help-block">
									        		<p>
									        			参数：{订单号}、{客户姓名}、{客户电话}、{交付时间}、{交付地点}
									        		</p>
									        		</span>
												</div>
										    </div>
										    
										    <div class="form-group">
										        <label class="col-sm-3 control-label">
										        	服务人员接单（发给客户）：
										        </label>
										        <div class="col-sm-5">
													<textarea rows="5" cols="60" id="acceptPaotuiOrder" name="acceptPaotuiOrder"><#if sms_acceptPaotuiOrder??>${sms_acceptPaotuiOrder.content?if_exists}</#if></textarea>
									        		<span class="help-block">
								        			<p>
									        			参数：{服务人员名称}、{服务人员工号}、{服务人员电话}、{订单号}
									        		</p>
								        			</span>
												</div>
										    </div>
										    
										    <div class="form-group">
										        <label class="col-sm-3 control-label">
										        	订单完成（发给客户）：
										        </label>
										        <div class="col-sm-6">
													<textarea rows="5" cols="60" id="finishPaotuiOrder" name="finishPaotuiOrder"><#if sms_finishPaotuiOrder??>${sms_finishPaotuiOrder.content?if_exists}</#if></textarea>
									        		<span class="help-block">
								        			<p>
									        			参数：{订单号}、{服务人员工号}、{等候时间}、{行驶公里}、{收费金额}、{支付方式}、{投诉建议电话}
									        		</p>
								        			</span>
												</div>
										    </div>
										    
									    </@pao>
								    </@shiro.hasPermission>
								</div>
							</div>
			  			</div>
			  			
						<div class="tab-pane fade" id="tab2">
							<div class="panel panel-default margin-top">
								<div class="panel-heading">收费内容</div>
								<div class="panel-body">
								    <div class="form-group">
					                    <label class="col-sm-1 control-label"></label>
					                    <div class="col-sm-10">
					                    	<textarea rows="5" cols="60" id="feeContent" name="feeContent">${company.feeContent?if_exists}</textarea>
					                    </div>
					                </div>
								</div>
							</div>
						</div>
				
						<div class="tab-pane fade" id="tab3">
							<div class="panel panel-default margin-top">
								<div class="panel-heading">客户推荐提成</div>
								<div class="panel-body">
									<@shiro.hasPermission name='memberrebate'>
										<input type="hidden" id="memberRebateId" name="memberRebateId" value="${memberRebate.id?if_exists}">
									    <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label"></label>
						                    <div class="col-sm-8">
						                    	<p class="form-control-static"><font color="red">注：不使用提成则设置为0或不填，一级提成指当前事件用户的推荐人。</font></p>
						                    </div>
						                </div>
						                
						                <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label"><em>*</em>提成类型：</label>
						                    <div class="col-sm-8">
						                    	<p class="form-control-static">
						                    		<label style="padding-right:30px;">
														<input type="radio" name="type_member" value="0" <#if memberRebate.type?? && memberRebate.type==0>checked="checked"</#if>> 一次性提成
													</label>
													<label style="padding-right:30px;">
														<input type="radio" name="type_member" value="1" <#if memberRebate.type?? && memberRebate.type==1>checked="checked"</#if>> 按单提成
													</label>
												</p>
						                    </div>
						                </div>
						                
						                <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label"><em>*</em>提成等级：</label>
						                    <div class="col-sm-3">
						                    	<select class="form-control" id="level_member" name="level_member" required>
						                    		<option value="0" <#if memberRebate.level?? && memberRebate.level==0>selected="selected"</#if>>不提成</option>
													<option value="1" <#if memberRebate.level?? && memberRebate.level==1>selected="selected"</#if>>一级提成</option>
													<option value="2" <#if memberRebate.level?? && memberRebate.level==2>selected="selected"</#if>>二级提成</option>
													<option value="3" <#if memberRebate.level?? && memberRebate.level==3>selected="selected"</#if>>三级提成</option>
						                    	</select>
						                    </div>
						                </div>
						                
						                <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label">客户端二维码分享说明：</label>
						                    <div class="col-sm-3">
						                    	<textarea rows="4" class="form-control" id="content" name="content_member">${memberRebate.content?if_exists}</textarea>
						                    </div>
					                	</div>
						                
						                <hr/>
						                
						                <div id="memberrebate_type_one" <#if memberRebate.type?? && memberRebate.type==0>style="display:block;"<#else>style="display:none;"</#if>>
						                	<div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">一级提成：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.disposableMoney1?if_exists}" name="disposableMoney1_member" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">二级提成：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.disposableMoney2?if_exists}" name="disposableMoney2_member" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">三级提成：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.disposableMoney3?if_exists}" name="disposableMoney3_member" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
						                </div>
						                
						                <div id="memberrebate_type_two" <#if memberRebate.type?? && memberRebate.type==1>style="display:block;"<#else>style="display:none;"</#if>>
						                	<div class="form-group">
						                	
							                	<h4><label class="col-sm-2 control-label">一级提成</label></h4>
							                	
							                    <label class="col-sm-2 control-label">提成（固定）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.money1?if_exists}" name="money1_member" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">提成（比例）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.commission1?if_exists}" name="commission1_member" type="number" min="0" max="100"/>
										            	<span class="input-group-addon">%</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                	<label class="col-sm-2 control-label">提成类型：</label>
						                    	<p class="form-control-static">
							                    	<label style="padding-right:20px;padding-left:15px;">
													  <input type="radio" name="memberRebateType1_member" value="guding" <#if memberRebate.memberRebateType1?? && memberRebate.memberRebateType1=='guding'>checked="checked"</#if> />使用固定提成
													</label>
													<label>
													  <input type="radio" name="memberRebateType1_member" value="percent" <#if memberRebate.memberRebateType1?? && memberRebate.memberRebateType1=='percent'>checked="checked"</#if>/>使用比例提成
													</label>
												</p>
							                </div>
							                <hr/>
							                
							                <div class="form-group">
							                	
							                	<h4><label class="col-sm-2 control-label">二级提成</label></h4>
							                	
							                    <label class="col-sm-2 control-label">提成（固定）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.money2?if_exists}" name="money2_member" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">提成（比例）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.commission2?if_exists}" name="commission2_member" type="number" min="0" max="100"/>
										            	<span class="input-group-addon">%</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                	<label class="col-sm-2 control-label">提成类型：</label>
						                    	<p class="form-control-static">
							                    	<label style="padding-right:20px;padding-left:15px;">
													  <input type="radio" name="memberRebateType2_member" value="guding" <#if memberRebate.memberRebateType2?? && memberRebate.memberRebateType2=='guding'>checked="checked"</#if> />使用固定提成
													</label>
													<label>
													  <input type="radio" name="memberRebateType2_member" value="percent" <#if memberRebate.memberRebateType2?? && memberRebate.memberRebateType2=='percent'>checked="checked"</#if>/>使用比例提成
													</label>
												</p>
							                </div>
							                <hr/>
									                
							                <div class="form-group">
							                	
							                	<h4><label class="col-sm-2 control-label">三级提成</label></h4>
							                	
							                    <label class="col-sm-2 control-label">提成（固定）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.money3?if_exists}" name="money3_member" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">提成（比例）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${memberRebate.commission3?if_exists}" name="commission3_member" type="number" min="0" max="100"/>
										            	<span class="input-group-addon">%</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                	<label class="col-sm-2 control-label">提成类型：</label>
						                    	<p class="form-control-static">
							                    	<label style="padding-right:20px;padding-left:15px;">
													  <input type="radio" name="memberRebateType3_member" value="guding" <#if memberRebate.memberRebateType3?? && memberRebate.memberRebateType3=='guding'>checked="checked"</#if> />使用固定提成
													</label>
													<label>
													  <input type="radio" name="memberRebateType3_member" value="percent" <#if memberRebate.memberRebateType3?? && memberRebate.memberRebateType3=='percent'>checked="checked"</#if>/>使用比例提成
													</label>
												</p>
							                </div>
						                </div>
					                </@shiro.hasPermission>
								</div>
							</div>
						</div>
						<div class="tab-pane fade" id="tab4">
							<div class="panel panel-default margin-top">
								<div class="panel-heading">服务人员推荐提成</div>
								<div class="panel-body">
									<@shiro.hasPermission name='driverrebate'>
										<input type="hidden" id="driverRebateId" name="driverRebateId" value="${driverRebate.id?if_exists}">
						                
						                <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label"><em>*</em>提成类型：</label>
						                    <div class="col-sm-8">
						                    	<p class="form-control-static">
						                    		<label style="padding-right:30px;">
														<input type="radio" name="type_driver" value="0" <#if driverRebate.type?? && driverRebate.type==0>checked="checked"</#if>> 一次性提成
													</label>
													<label style="padding-right:30px;">
														<input type="radio" name="type_driver" value="1" <#if driverRebate.type?? && driverRebate.type==1>checked="checked"</#if>> 按单提成
													</label>
												</p>
						                    </div>
						                </div>
						                
						                <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label"><em>*</em>提成等级：</label>
						                    <div class="col-sm-3">
						                    	<select class="form-control" id="level_driver" name="level_driver" required>
						                    		<option value="0" <#if driverRebate.level?? && driverRebate.level==0>selected="selected"</#if>>不提成</option>
													<option value="1" <#if driverRebate.level?? && driverRebate.level==1>selected="selected"</#if>>一级提成</option>
						                    	</select>
						                    </div>
						                </div>
						                
						                <div class="form-group">
						                	<label class="col-sm-2 control-label"></label>
						                    <label class="col-sm-2 control-label">司机端二维码分享说明：</label>
						                    <div class="col-sm-3">
						                    	<textarea rows="4" class="form-control" id="content" name="content_driver">${driverRebate.content?if_exists}</textarea>
						                    </div>
					                	</div>
					                	
						                <div id="driverrebate_type_one" <#if driverRebate.type?? && driverRebate.type==0>style="display:block;"<#else>style="display:none;"</#if>>
						                	<div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">提成：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${driverRebate.disposableMoney1?if_exists}" name="disposableMoney1_driver" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
						                </div>
						                
						                <div id="driverrebate_type_two" <#if driverRebate.type?? && driverRebate.type==1>style="display:block;"<#else>style="display:none;"</#if>>
						                	<div class="form-group">
						                	
							                	<h4><label class="col-sm-2 control-label"></label></h4>
							                	
							                    <label class="col-sm-2 control-label">提成（固定）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${driverRebate.money1?if_exists}" name="money1_driver" type="number" min="0"/>
										            	<span class="input-group-addon">元</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                    <label class="col-sm-2 control-label">提成（比例）：</label>
							                    <div class="col-sm-3">
								                    <div class="input-group">
										            	<input class="form-control" value="${driverRebate.commission1?if_exists}" name="commission1_driver" type="number" min="0" max="100"/>
										            	<span class="input-group-addon">%</span>
									                </div>
							                    </div>
							                </div>
							                <div class="form-group">
							                	<label class="col-sm-2 control-label"></label>
							                	<label class="col-sm-2 control-label">提成类型：</label>
						                    	<p class="form-control-static">
							                    	<label style="padding-right:20px;padding-left:15px;">
													  <input type="radio" name="driverRebateType1_driver" value="guding" <#if driverRebate.driverRebateType1?? && driverRebate.driverRebateType1=='guding'>checked="checked"</#if> />使用固定提成
													</label>
													<label>
													  <input type="radio" name="driverRebateType1_driver" value="percent" <#if driverRebate.driverRebateType1?? && driverRebate.driverRebateType1=='percent'>checked="checked"</#if>/>使用比例提成
													</label>
												</p>
							                </div>
				
						                </div>
					                </@shiro.hasPermission>
								</div>
							</div>
						</div>
				
						<div class="tab-pane fade in" id="tab5">
					    	<div class="panel panel-default margin-top">
								<div class="panel-heading">
									客户二维码背景图
									<button type="button" href="javascript:;" class="pull-right uploadify-button " style="height:25px;line-height:25px;width:120px;" id="picture_upload_dialog"><i class="glyphicon glyphicon-open"></i>&nbsp;图片上传</button>
								</div>
								<div class="panel-body">
									<div class="col-md-5">
										<div class="form-group">
											 <label class="col-sm-6 control-label"></label>
										     <div class="col-sm-6">
												<img id="picture_img" width="216" height="384" <#if company.picture??>src="${ctx}/${company.picture?if_exists}"</#if>/>
												<input style="display:none;" type="file" name="imgFile" id="picture_file" accept=".bmp,.gif,.jpeg,.jpg,.png">
												<input type="hidden" id="picture" name="picture" value="${company.picture?if_exists}">
											</div>
										</div>	
									</div>
									<div class="col-md-6">
									
										<div class="form-group">
						                    <label class="col-sm-3 control-label">提示：</label>
						                    <div class="col-sm-6">
						                    	<p class="form-control-static">图片用于客户扫描二维码后看到的界面</p>
						                    	<p>建议大小：1080 x 1920</p>
						                    	<p>标题和内容用于分享后看见的文字</p>
						                    </div>
					                	</div>
					                	
					                	<div class="form-group">
						                    <label class="col-sm-3 control-label">标题：</label>
						                    <div class="col-sm-6">
						                    	<input class="form-control" id="introduceTitle" name="introduceTitle" type="text" value="${company.introduceTitle?if_exists}" />
						                    </div>
					                	</div>
					                	
					                	<div class="form-group">
						                    <label class="col-sm-3 control-label">内容：</label>
						                    <div class="col-sm-6">
						                    	<textarea rows="5" class="form-control" id="introduceContent" name="introduceContent">${company.introduceContent?if_exists}</textarea>
						                    </div>
					                	</div>
					                	
									</div>
								</div>
							</div>
						</div>
				
						<div class="tab-pane fade" id="tab6">
							<div class="panel panel-default margin-top">
								<div class="panel-heading">
									服务人员二维码背景图
									<button type="button" href="javascript:;" class="pull-right uploadify-button  button-tiny" style="height:25px;line-height:25px;width:120px;" id="picture2_upload_dialog"><i class="glyphicon glyphicon-open"></i>&nbsp;图片上传</button>
								</div>
								<div class="panel-body">
									<div class="col-md-5">
										<div class="form-group">
											 <label class="col-sm-6 control-label"></label>
										     <div class="col-sm-6">
												<img id="picture2_img" width="216" height="384" <#if company.picture2??>src="${ctx}/${company.picture2?if_exists}"</#if>/>
												<input style="display:none;" type="file" name="imgFile" id="picture2_file" accept=".bmp,.gif,.jpeg,.jpg,.png">
												<input type="hidden" id="picture2" name="picture2" value="${company.picture2?if_exists}">
											</div>
										</div>	
									</div>
									<div class="col-md-6">
									
										<div class="form-group">
						                    <label class="col-sm-3 control-label">提示：</label>
						                    <div class="col-sm-6">
						                    	<p class="form-control-static">图片用于客户扫描服务人员二维码后看到的界面</p>
						                    	<p>建议大小：1080 x 1920</p>
						                    	<p>标题和内容用于分享后看见的文字</p>
						                    </div>
					                	</div>
					                	
					                	<div class="form-group">
						                    <label class="col-sm-3 control-label">标题：</label>
						                    <div class="col-sm-6">
						                    	<input class="form-control" id="introduceTitle2" name="introduceTitle2" type="text" value="${company.introduceTitle2?if_exists}" />
						                    </div>
					                	</div>
					                	
					                	<div class="form-group">
						                    <label class="col-sm-3 control-label">内容：</label>
						                    <div class="col-sm-6">
						                    	<textarea rows="5" class="form-control" id="introduceContent2" name="introduceContent2">${company.introduceContent2?if_exists}</textarea>
						                    </div>
					                	</div>
					                	
									</div>
								</div>
							</div>
						</div>
						
						<div class="tab-pane fade" id="tab7">
							<div class="panel panel-default margin-top">
								<div class="panel-heading">服务协议</div>
								<div class="panel-body">
								    <div class="form-group">
					                    <label class="col-sm-1 control-label"></label>
					                    <div class="col-sm-10">
					                    	<textarea rows="50" cols="200" id="agreement" name="agreement">${company.agreement?if_exists}</textarea>
					                    	<span class="help-block">配置服务协议，用于在APP中进行显示。</span>
					                    </div>
					                </div>
								</div>
							</div>
						</div>
						<div class="tab-pane fade" id="tab8">
							<div class="panel panel-default margin-top">
								<div class="panel-heading">分享设置</div>
								<div class="panel-body">
								
									<div class="form-group">
					                    <label class="col-sm-3 control-label">分享标题：</label>
					                    <div class="col-sm-3">
					                        <input type="text" class="form-control" id="shareTitle" name="shareTitle" maxlength="20" value="${company.shareTitle?if_exists}">
					                    	<span class="help-block">配置分享标题，用于在APP中进行显示，20字以内。</span>
					                    </div>
					                </div>
					                <div class="form-group">
								        <label class="col-sm-3 control-label">分享内容：</label>
								        <div class="col-sm-9">
											<textarea rows="8" cols="58" id="shareContent" name="shareContent" maxlength="140">${company.shareContent?if_exists}</textarea>
											<span class="help-block">配置分享内容，用于在APP中进行显示，140字以内。</span>
										</div>
							    	</div>
							    	<div class="form-group">
								        <label class="col-sm-3 control-label">分享图片：</label>
								        <div class="col-sm-2">
											<img id="shareImage_img" <#if company.shareImage??>src="${ctx}/${company.shareImage}"</#if>  width="225" height="225" />
											<input style="display:none;" type="file" name="imgFile" id="shareImage_file" accept=".bmp,.gif,.jpeg,.jpg,.png">
											<input type="hidden" id="shareImage" name="shareImage" value="${company.shareImage?if_exists}">
											<span class="help-block">单击上传图片,建议图片大小450×450。</span>
										</div>
								        <div class="col-sm-2">
											<button type="button" class="pull-right uploadify-button  button-tiny" style="height:25px;line-height:25px;width:120px;" id="shareImage_btn"><i class="glyphicon glyphicon-open"></i>&nbsp;图片上传</button>
										</div>
							  	    </div>
							    	<div class="form-group">
					                    <label class="col-sm-3 control-label">分享链接：</label>
					                    <div class="col-sm-3">
					                        <input type="text" class="form-control" id="shareURL" name="shareURL"  value="${company.shareURL?if_exists}">
					                    	<span class="help-block">配置分享链接，用于在APP中分享使用,必须以"http://"开头</span>
					                    </div>
					                </div>
					                
								</div>
							</div>
						</div>
						
						
					</div>
					
			  </form>
		</div>
	</div>
</div>
</@override>
<@override name="footer">
	<script src="${ctx}/assets/js/ajaxfileupload.js"></script>
	<script src="${ctx}/assets/kindeditor/kindeditor-all-min.js"></script>
	<script src="${ctx}/assets/kindeditor/lang/zh_CN.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			
			//客户推荐提成类型
			$("input[name=type_member]").change(function(){
				if($(this).val()=="0"){
					$("#memberrebate_type_two").slideUp(300);
					$("#memberrebate_type_one").fadeIn(500);
				}
				else if($(this).val()=="1"){
					$("#memberrebate_type_one").slideUp(300);
					$("#memberrebate_type_two").fadeIn(500);
				}
			});
			
			//司机推荐提成类型
			$("input[name=type_driver]").change(function(){
				if($(this).val()=="0"){
					$("#driverrebate_type_two").slideUp(300);
					$("#driverrebate_type_one").fadeIn(500);
				}
				else if($(this).val()=="1"){
					$("#driverrebate_type_one").slideUp(300);
					$("#driverrebate_type_two").fadeIn(500);
				}
			});
		
			KindEditor.ready(function(K) {
				K.create('#feeContent',{
					filterMode : false,
					uploadJson : '${ctx}/common/kindeditor/fileupload',
					allowUpload : true,
					fileManagerJson : '${ctx}/common/kindeditor/filemanager',
					allowFileManager : true,
					height:500,
					width:'100%',
					resizeType:0,
					afterCreate : function() {
						var self = this;
						K.ctrl(document, 13, function() {
							self.sync();
						});
						K.ctrl(self.edit.doc, 13, function() {
							self.sync();
						});
					},
					afterBlur:function(){ 
						this.sync();
					}
				});
			});
		KindEditor.ready(function(K) {
				K.create('#agreement',{
					filterMode : false,
					uploadJson : '${ctx}/common/kindeditor/fileupload',
					allowUpload : true,
					fileManagerJson : '${ctx}/common/kindeditor/filemanager',
					allowFileManager : true,
					height:500,
					width:'100%',
					resizeType:0,
					afterCreate : function() {
						var self = this;
						K.ctrl(document, 13, function() {
							self.sync();
						});
						K.ctrl(self.edit.doc, 13, function() {
							self.sync();
						});
					},
					afterBlur:function(){ 
						this.sync();
					}
				});
			});
			//分享图片上传
			$("#shareImage_img").click(function(){
				$("#shareImage_file").click();
			});
			$("#shareImage_btn").click(function(){
				$("#shareImage_file").click();
			});
			$(document).on('change','#shareImage_file',function(){
				if($.trim($(this).val())){
				 	$.ajaxFileUpload({
		                url:'${ctx}/common/uploadimg',
		                secureuri:false,
		                fileElementId:'shareImage_file',
		                dataType: 'json',
		                success: function (result, textStatus) {
		                	if(result.success){
		                		$.scojs_message("上传成功", $.scojs_message.TYPE_OK);
		                    	$("#shareImage_img").attr("src","${ctx}/"+result.url);
		                    	$("#shareImage").val(result.url);
		                	}
		                	else{
		                		$.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
		                	}
		                }
		            });
				}
			});
			
			$("#picture_upload_dialog").click(function(){
				$("#picture_file").click();
			});
			$(document).on('change','#picture_file',function(){
				if($.trim($(this).val())){
				 	$.ajaxFileUpload({
		                url:'${ctx}/common/uploadimg',
		                secureuri:false,
		                fileElementId:'picture_file',
		                dataType: 'json',
		                success: function (result, textStatus) {
		                	if(result.success){
		                		$.scojs_message("上传成功", $.scojs_message.TYPE_OK);
		                    	$("#picture_img").attr("src","${ctx}/"+result.url);
		                    	$("#picture").val(result.url);
		                	}
		                	else{
		                		$.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
		                	}
		                }
		            });
				}
			});
			
			
			$("#picture2_upload_dialog").click(function(){
				$("#picture2_file").click();
			});
			$(document).on('change','#picture2_file',function(){
				if($.trim($(this).val())){
				 	$.ajaxFileUpload({
		                url:'${ctx}/common/uploadimg',
		                secureuri:false,
		                fileElementId:'picture2_file',
		                dataType: 'json',
		                success: function (result, textStatus) {
		                	if(result.success){
		                		$.scojs_message("上传成功", $.scojs_message.TYPE_OK);
		                    	$("#picture2_img").attr("src","${ctx}/"+result.url);
		                    	$("#picture2").val(result.url);
		                	}
		                	else{
		                		$.scojs_message(result.msg, $.scojs_message.TYPE_ERROR);
		                	}
		                }
		            });
				}
			});
			$("#shareURL").blur(function(){
					var url=$("#shareURL").val().trim();
					if(url.length>0){
						var index=url.indexOf("http://");
						if(index==-1 || index!=0){
							$.scojs_message("分享路径必须以http://开头", $.scojs_message.TYPE_ERROR);
						}
					}
			});	
			//提交表单
			$("#submit_form").submit(function(){
				var url=$("#shareURL").val().trim();
				var image=$("#shareImage").val().trim();
				var content=$("#shareContent").val().trim();
				var title=$("#shareTitle").val().trim();
				if(title.length>0){
					if(url.length<=0){
						$.scojs_message("请填写分享路径", $.scojs_message.TYPE_ERROR);
						return false;
					}
				}
				if(content.length>0){
					if(title.length<=0){
						$.scojs_message("请填写分享标题", $.scojs_message.TYPE_ERROR);
						return false;
					}
				}
				if(image.length>0){
					if(content.length<=0){
						$.scojs_message("请填写分享内容", $.scojs_message.TYPE_ERROR);
						return false;
					}
				}
				if(url.length>0){
					var index=url.indexOf("http://");
					if(index==-1 || index!=0){
						$.scojs_message("分享路径必须以http://开头", $.scojs_message.TYPE_ERROR);
						return false;
					}
					if(image.length<=0){
						$.scojs_message("请上传要分享的图片", $.scojs_message.TYPE_ERROR);
						return false;
					}
				}
				if(!$("#signName").val().trim()){
					$.scojs_message("短信签名不能为空" , $.scojs_message.TYPE_ERROR);
					return false;
				}else{
					$("#submit_button").attr("disabled",true);
					return true;
				}
			});
		});
	</script>
</@override>
<@extends name="../layout.ftl"/>